﻿@model IEnumerable<IRIS.Models.Content>

@{
    ViewBag.Title = "RetrieveArticle";
}

<h2>Sækja Eydd Gögn</h2>
<p>Greinar þarf svo að samþykkja aftur.</p>

@if (Model.Count() > 0)
{
    using (Html.BeginForm())
    {

    <table>
        <tr>
            <th>
                Titill
            </th>
            <th>
                Lýsing
            </th>
            <th>
                Sett inn
            </th>
            <th>
                Höfundur
            </th>
            <th>
                Sækja      
            </th>
        </tr>
        @{int i = 0;}
        @foreach (var item in Model)
        {
            <tr>
                <td>@item.ContentTitle</td>
                <td>@{ var segment = item.Description; } 
			        @Html.Raw(segment)</td>
                <td>@item.Created.ToShortDateString()</td>
		        <td>@item.Author</td>
	    	    <td><input type="checkbox" id="retrieve|@item.ID" name="retrieve|@item.ID" value="true" /></td>
		        <td><input type="hidden" id="articleId|@i" name="articleId|@i" value="@item.ID" /></td>
            </tr>
            i++;
        }
    </table>
 
     <p>
            <input type="submit" value="Sækja Greinar" />
     </p> 
    }
}
else
{
    <p>Engar Greinar hafa verið eyddar nýlega.</p>
}